#@adminLayout()
#define main()
<div class="jbolt_page" data-key="#(pmkey)">
<div class="jbolt_page_title">
	<div class="row">
	<div class="col-9">
	<h1>系统资源权限管理</h1>
	<span style="color:red;font-weight: bold;">[注意：非开发人员请勿操作本页面]</span>
	</div>
	<div class="col-3">
		<button data-ajaxbtn data-confirm="确认初始化权限资源的顺序吗？" data-handler="refreshJBoltTable" data-title="初始化排序" data-url="admin/permission/initRank" class="pull-right  btn btn-primary" ><i class="fa fa-sort"></i> 初始化排序</button>
		<button data-area="1080,750" id="permission_addbtn" data-scroll="yes" data-handler="refreshJBoltTable" data-title="新增权限资源" data-url="admin/permission/add/0-1" class="pull-right jbolt_table_addbtn btn btn-success" ><i class="fa fa-plus"></i> 新增</button>
	</div>
	</div>
</div>
<div class="jbolt_page_content">
<div class="table-responsive">
<!-- JBoltTable的数据模板定义-->
<script type="text/template" id="permission_rowtpl_tr">
<tr data-id="${id}" data-pid="${pid}">
<td class="text-left">
{@if permissionLevel==2}
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:red;font-size:14px;top:-5px;">├ </span>
{@else if permissionLevel==3}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:red;font-size:14px;top:-5px;">├ </span>
{@/if}
<i class="${icons}"></i> ${title}
</td>
<td  class="text-center">
{@if url}${isTargetBlank?"浏览器新窗口":"浏览器当前窗口"}{@/if}
</td>
<td class="text-center">
	{@if openType===1}
		系统默认
	{@else if openType === 2}
		IFrame
	{@else if openType === 3}
		Dialog
	{@else if openType === 4}
		JBoltLayer
	{@/if}
</td>
<td>
{@if isMenu}
<span class="badge badge-primary">菜单</span>
{@else}
<span class="badge badge-info">非菜单</span>
{@/if}
</td>
<td  class="text-left">${url}</td>
<td  class="text-left">${permissionKey}</td>
<td>
<img data-switchbtn data-confirm="确定切换此权限是否是超管默认使用权限？" data-value="${isSystemAdminDefault}"  data-handler="LayerMsgBox.success('操作成功',1000,refreshJBoltTable)"  data-url="admin/permission/toggleSystemAdminDefault/${id}"/>
</td>
<td class="text-right">
{@if permissionLevel!=3}
<a href="admin/permission/add/${id}-${permissionLevel+1}" data-area="1080,750"  tooltip data-title="添加下级资源"   data-handler="refreshJBoltTable"  dialog-title="添加下级资源" class="jbolt_table_editbtn"><i class="fa fa-plus"></i></a>
{@/if}
<a href="admin/permission/edit/${id}" data-area="1080,750"  tooltip data-title="编辑"  data-handler="refreshJBoltTable" dialog-title="编辑资源" class="jbolt_table_editbtn"><i class="fa fa-pencil"></i></a>
<a href="admin/permission/delete/${id}" data-ajaxbtn data-loading="执行中 " tooltip data-title="删除" data-handler="removeTrCascade" data-confirm="确定删除这条数据？" class="jbolt_table_delbtn"><i class="fa fa-remove  c-danger"></i></a>
<a href="admin/permission/up/${id}" data-ajaxbtn data-loading="执行中 " tooltip data-title="上移" data-handler="moveUp"   class="jbolt_table_btn"><i class="fa fa-arrow-up c-info"></i></a>
<a href="admin/permission/down/${id}" data-ajaxbtn data-loading="执行中 " tooltip data-title="下移" data-handler="moveDown"  class="jbolt_table_btn"><i class="fa fa-arrow-down c-info"></i></a>
</td>
</tr>
{@if items&&items.length>0}
{@each items as son}
{@include "#permission_rowtpl_tr",son}
{@/each}
{@/if}
</script>
<script type="text/template" id="permission_rowtpl">
{@each datas as data,index}
{# 先循环第一级}
{@include "#permission_rowtpl_tr",data}
{@/each}
</script>

<table class="table table-bordered table-hover table-center text-nowrap thead_font_normal"
data-jbolttable
data-fixed-columns-left="1"
data-fixed-columns-right="8"
data-column-resize="true"
data-ajax="true"
data-url="admin/permission/datas"
data-rowtpl="permission_rowtpl"
data-bind-elements="#permission_addbtn"
>
<thead>
<tr>
	<th data-width="260"  data-nochange>资源</th>
	<th data-width="130"  data-nochange>加载方式</th>
	<th data-width="130"  data-nochange>打开类型</th>
	<th  data-width="100"  data-nochange>资源类型</th>
	<th data-width="auto" data-min-width="200">URL</th>
	<th data-width="auto">KEY</th>
	<th  data-width="100"  data-nochange>超管默认</th>
	<th data-width="150"  data-nochange>操作</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
#end
#define js()
<script>
$(function(){
});
</script>
#end